/**
 * @file rank/elementary/luogu1075/main.cpp
 * @brief
 * @see
 * @author Ruiming Guo (guoruiming@stu.scu.edu.cn)
 * @copyright 2022
 * @date 2022/7/7 13:33:13
 **/

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main() {
  // High rating and good luck!
  int n;
  cin >> n;
  for (int i = 2; i <= n / i; ++i) {
    if (n % i == 0) {
      cout << n / i << endl;
      return 0;
    }
  }
  return 0;
}
